<template>
  <div class="common-icon-button"
       @click="$emit('click',$event)"
       :style="{'--theme-color': systemInfo.theme}">
    <i :class="['iconfont',icon]"></i>
    <span class="content">{{ content }}</span>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'IconButton',
  props: {
    icon: {
      type: String,
      default: 'icon-guanxitu'
    },
    content: {
      type: String,
      default: '按钮'
    }
  },
  computed: {
    ...mapGetters(['systemInfo'])
  }
}
</script>

<style scoped lang="scss">
.common-icon-button {
  white-space: nowrap;
  text-align: center;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  padding: 0 8px;
  box-sizing: border-box;
  color: var(--theme-color);
  cursor: pointer;

  i {
    font-size: 12px;
  }

  .content {
    margin-left: 4px;
    font-size: 12px;
  }
}
</style>
